const routes = [
  {
    path: '/home',
    name: 'home',
    component: () => import('../views/HomeView.vue'),
    children: [
      {
        path: '/home/index',
        name: 'index',
        component: () => import('../views/home/index.vue'),
        meta: { title:'首页'},  //meta  路由元信息，永远跟着路由跳
      },
      {
        path: '/home/bbt',
        name: 'bbt',
        component: () => import('../views/home/bbt.vue'),
        meta: { title:'爆爆团'},
      },
      {
        path: '/home/order',
        name: 'order',
        component: () => import('../views/home/order.vue'),
        meta: { title:'订单'},
      },
      {
        path: '/home/mine',
        name: 'mine',
        component: () => import('../views/home/mine.vue'),
        meta: { title:'我的'},
      },
      {
        path: '/home',
        redirect: '/home/index'//重定向
      },
      {
        path: '*',
        component: () => import('../views/NotFound.vue')
      }
    ]
  },
    //登录
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/LoginView.vue'),
    meta: { title:'登录'},
  },

  {
    path: '/register',
    name: 'register',
    component: () => import('../views/RegisterView.vue'),
    meta: { title:'注册'},
  },
  
  {
    path: '/shop/:id',
    name: 'shop',
    component: () => import('../views/ShopView.vue'),
    meta: { title:'店铺'},
  },
  {
    path: '/',
    redirect: '/register'//重定向
  },
  {
    path: '*',
    component: () => import('../views/NotFound.vue'),
  }
]

export default routes;